﻿namespace Jim.OA;

/// <summary>
/// 发送消息
/// </summary>
[Sdk("/api/ec/dev/message/sendCustomMessageSingle",description: "发送消息")]
public class OASendMessageInput : ISdkRequest<OASendMessageOutput>, ISdkCustomDic
{
    /// <summary>
    /// 消息来源（见文档第四点补充）
    /// </summary>
    [Required]
    public string Code { get; set; }
    /// <summary>
    /// 接收人OA系统id
    /// </summary>
    public string UserIdList { get; set; }
    /// <summary>
    /// 接收人登录名
    /// </summary>
    public string LoginIdList { get; set; }
    /// <summary>
    /// 接收人编号
    /// </summary>
    public string WorkCodeList { get; set; }
    /// <summary>
    /// 接收人接收人姓名
    /// </summary>
    public string LastNameList { get; set; }
    /// <summary>
    /// 创建人 OA系统id/登录名/编号/姓名（对应接收人所传入的形式）
    /// </summary>
    public string Creater { get; set; }
    /// <summary>
    /// 标题
    /// </summary>
    public string Title { get; set; }
    /// <summary>
    /// 内容
    /// </summary>
    public string Context { get; set; }
    /// <summary>
    /// PC端链接
    /// </summary>
    public string LinkUrl { get; set; }
    /// <summary>
    /// 移动端链接
    /// </summary>
    public string LinkMobileUrl { get; set; }
    /// <summary>
    /// 消息来源code+"|"+业务id 需要修改消息状态时传入
    /// </summary>
    public string TargetId { get; set; }
    /// <summary>
    /// 0 表示消息初始状态是待处理 需要修改消息状态时传入
    /// </summary>
    /// <returns></returns>
    public string BizState { get; set; }

    public SdkDictionary Dic()
    {
        SdkDictionary dic = new SdkDictionary();
        if (!string.IsNullOrEmpty(Code)) dic.Add("code", Code);
        if (!string.IsNullOrEmpty(UserIdList)) dic.Add("userIdList", UserIdList);
        if (!string.IsNullOrEmpty(LoginIdList)) dic.Add("loginIdList", LoginIdList);
        if (!string.IsNullOrEmpty(WorkCodeList)) dic.Add("workCodeList", WorkCodeList);
        if (!string.IsNullOrEmpty(LastNameList)) dic.Add("lastNameList", LastNameList);
        if (!string.IsNullOrEmpty(Creater)) dic.Add("creater", Creater);
        if (!string.IsNullOrEmpty(Title)) dic.Add("title", Title);
        if (!string.IsNullOrEmpty(Context)) dic.Add("context", Context);
        if (!string.IsNullOrEmpty(LinkUrl)) dic.Add("linkUrl", LinkUrl);
        if (!string.IsNullOrEmpty(LinkMobileUrl)) dic.Add("linkMobileUrl", LinkMobileUrl);
        if (!string.IsNullOrEmpty(TargetId)) dic.Add("targetId", TargetId);
        if (!string.IsNullOrEmpty(BizState)) dic.Add("bizState", BizState);
        return dic;
    }
}

public class OASendMessageOutput : SdkResponse { 

}